#include "Scene.hpp"
#include "m3g/m3g.hpp"
using namespace m3g;
using namespace m3g_viewer;


Scene:: Scene () : g3d(0), world(0), camera(0), scene_camera(0), background(0)
{
    g3d = Graphics3D::getInstance ();

    world = new World ();

    camera = new Camera ();
    camera->setPerspective (60, 1.333, 1, 100);
    camera->lookAt (0,0,10,
                    0,0,0,
                    0,1,0);

    background = new Background ();
    background->setColor (0xff0000ff);

    world->addChild (camera);
    world->setActiveCamera (camera);
    world->setBackground (background);
}

Scene:: ~Scene ()
{

}

void Scene:: render () const
{
    g3d->render (world);
}

void Scene:: load (const char* name)
{
    
}


// NULLは返さない
m3g::Camera* Scene:: get_camera () const
{
    return 0;
}

m3g::World* Scene:: get_world () const
{
    return world;
}


